package cn.lili.event.impl;

import cn.lili.event.GoodsCommentCompleteEvent;
import cn.lili.modules.goods.client.GoodsSkuClient;
import cn.lili.modules.member.entity.dos.MemberEvaluation;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 商品SKU变化
 *
 * @author Chopper
 * @since 2020-07-03 11:20
 */
@Service
@RequiredArgsConstructor
public class GoodsSkuExecute implements GoodsCommentCompleteEvent {

    /**
     * 商品
     */
    private final GoodsSkuClient goodsSkuClient;

    @Override
    public void goodsComment(MemberEvaluation memberEvaluation) {
        goodsSkuClient.updateGoodsSkuCommentNum(memberEvaluation.getSkuId());
    }
}
